imgTECH/IV This document contains a brief introduction to the imgTECH/IV image viewer. The following topics will be considered: 1. What is imgTECH/IV and what is it useful for? 2. What are the hardware requirements? 3. What capabilities does it have? 4. What limitations does it have? 5. Installation 6. Using imgTECH/IV 1. What is imgTECH/IV? imgTECH/IV is an image viewer. That is, it can read digitized pictures, display them and manipulate them in various way. 2. Hardware requirements a) 386SX or higher CPU b) At least one megabyte of memory c) A hard disk with at least two megabytes free d) A mouse 3. imgTECH/IV capabilities a) IV is a 32 bit program. As such it requires a 386 or higher CPU. Since displaying an image require a lot of memory, IV will use all extended memory installed in the computer and will then use the hard disk as virtual memory. IV requires a VGA system, and operates it in 256 color mode with one of the following resolutions: 1. 640x480x256 2. 800x600x256 3. 1024x768x256 b) IV allows multiple images to be loaded in memory and displayed in the screen at once. Images may be of arbitrary size. If the image is larger than the screen resolution (ie. an 800x600 pixel image and a 640x480 pixel screen) the image will be clipped to fit the screen. The image may be scrolled using the CTRL+ARROW keys. c) IV can read and write images in the following formats: IV native format (faster), BMP, PCX, JPG, TIFF, GIF and ASCII. An ascii image is a text file in the following format: Line 1: # of rows Line 2: # of columns Line 3 -> 2+rows: pixel values for that row (# columns values) d) IV supports image stacks. An image stack is an image file that contains a number of individual images. An image stack may represent: 1. A time series. That is, a series of pictures of an object taken at different times. 2. The third spatial dimension. Images are two dimensional, but an image stack may be a series of pictures taken at various depths. 3. A number of images that are somehow related, and stored together for convenience. For example, a number of images may be stored together and shown in sequence creating a slide show. 4. A totally unrelated set of images. e) IV supports the following general kinds of images: 1. Grey scale images. Each pixel in the image represents light intensity at that point in the image. No palette is stored with the image. The image is shown with a grey scale palette (the IV default). These images may be 8 bit (0<=pixel value<=255) or 16 bit (0<=pixel value<=65536). 2. Color images. Each pixel in the image represents an index into a color palette (usually 256 colors) stored with the image. IV will load the image's palette whenever the image is shown. Since IV can show many different images at once, and since the VGA mode used by IV is restricted to only 256 different colors, when one color image is displayed, other color images already on the screen may end up looking strange because a different palette is loaded. NOTE: displaying a 256 color image may change the colors IV uses for menus and dialog boxes... This is because there are no more colors left for IV to use. 3. 24 bit color images are currently not supported. JPEG images are converted to 8 bit color images. f) IV provides the following functions: 1. scale -- scale an image up or down. X and Y may have different scale factors. The scale factor is determined by specifying the numerator and denominator. For example, to scale an image by 1.5 in the X direction and 0.67 in Y the Y direction: X: numerator = 3 denominator = 2 3/2=1.5 Y: numerator = 2 denominator = 3 2/3=0.67 2. rotate -- rotate an image by 90, 180 or 270 degrees. 3. mirror -- create a mirror image. 4. zoom -- zoom in on a small part of an image. 5. greyscale -- convert a color image into a grey scale image. The red, green and blue components of each color in the image's palette are used to find a grey scale intensity for that color. 6. movie -- display each image in an image stack in rapid succession. Creating a movie or slide show effect. Note: the number of frames per second displayed depends on the size of the image. 7. tile -- display a number of images in an image stack at once. 8. insert -- insert an image into an image stack. 9. delete -- delete an image from an image stack. 10. split -- split up an image stack into a number of single images. 11. cut -- cut a portion of an image out, creating a new image. 12. paste -- paste one image into another. 13. undo/redo g) IV has hypertext help. h) The IV interface features drop down menus and a command line. i) All IV functions are available from macros. IV can create macros by recording a series of key strokes. Macros are stored in ascii text files so that they may be later edited and refined as necessary. Macros also support looping and if-then constructs. k) IV has a full screen mode in which an image is displayed on the screen by itself without any menus etc. This is a useful mode for creating slide shows. l) Gamma correction. 4. imgTECH/IV limitations a) No 24 bit color images. JPEG images are converted to 8 bit color images when they are being decoded. b) Doesn't use 32K, 64K color, 24 bit VESA modes when available. c) Doesn't support, or even run, under operating environments other than DOS such as Windows or OS/2. See part g below. d) Doesn't read compressed TIFF images. e) Cannot print images. Images must be imported into a word processor or desktop publisher to be printed. f) Doesn't support image editing (drawing lines, adding text etc.) g) The CPU *must* be in real mode when starting IV. IV will then switch to protected mode. Some drivers loaded at bootup, notably memory managers such as EMM386.EXE switch the CPU to virtual 8086 (V86) mode, which is incompatible with IV. Several options exist with EMM386.EXE: 1. Get rid of EMM386 altogether 2. Start EMM386 with the OFF or AUTO parameters DEVICE=C:\DOS\EMM386.EXE OFF or DEVICE=C:\DOS\EMM386.EXE AUTO 3. Start EMM386 without any parameters or specify an amount of EMS for it to emulate, then turn it off before running IV and turn it on again afterward. DEVICE=C:\DOS\EMM386.EXE --- C:\DOS\EMM386 OFF IV C:\DOS\EMM386 ON --- 5. Installing imgTECH/IV a) Place the installation disk in drive A: b) Type a: c) Type install d) Install will examine the video system, if it is recognized, install will ask for confirmation. If install doesn't recognize the video system or is incorrect, you may select a driver from the list presented. e) When installation is complete, IV may be started by typing iv from the DOS command line. Note: IV requires the CPU to be in real mode. Programs like Windows and some EMS emulators put the CPU in Virtual 86 (V86) mode, and are thus incompatible with IV. See above. IV can also install from a hard disk if so desired. Make sure that the directory to which you are installing is not the same as the directory from which you are installing. Whenever the configuration of the computer is changed, such as changing video cards, adding a math coprocessor or changing path names, run the program ivconfig. This will tell IV about the changes. IV may be started from any directory, as long as the file iv.cfg is located in a directory named in the path statement. iv.cfg is created by ivconfig. 6. Using imgTECH/IV When IV starts, it will show a message indicating the program's serial number and the person to whom the program is registered. Press any key to get past this message. a) Using the menus Clicking on a menu title, or pressing ALT+The highlighted letter in the menu name will cause the menu to drop down. Use the arrow keys to move the scroll bar from item to item, or else click (using the left mouse button) on the desired item. Pressing ENTER or pressing the right mouse button (always equivalent to pressing ENTER) will select the item. Alternatively, double clicking (with the left mouse button) on an item will select it. Many functions will require further input. In these cases, IV will prompt for whatever information is still required. b) Using the command line All IV functions are available from the command line. This is a faster interface for people familiar with IV. The command line syntax is described below. NOTE: items in square brackets are optional, a bar | separates items where either one or the other may be used. If optional items are not given on the command line, IV will prompt for them. Commands may be abbreviated by the first two letters in the command. open [files] save [[pal kern filt [as image file]] images] close [[all] [images]] run [commandline] shell quit show [[all] [images]] erase [[all] [images]] scale [xmul xdiv ymul ydiv [images]] or [image] rotate [angle [images]] or [image] mirror [images] greyscale [images] paste [image1 image2 [x y [op]]] cut [image [x1 y1 x2 y2]] stats [image [x1 y1 x2 y2]] movie [images] tile [images] insert [image1 [image2 [image_number]] delete [image [image_number]] split [images] execute [file] record [file] ascii [images] abox [images] aline [image [file [x1 y1 x2 y2]]] set [stack|backup|coordinates|keywait|delay#|continuous |playbackward|fullscreen|gamma #|quality #|directory| dir] unset [stack|backup|coordinates|keywait|delay #| continuous|playbackward|fullscreen] convert [image [bmp|pcx|jpg|gif|tiff|ascii]] fullscreen unfullscreen zoom [image [x1 y1 x2 y2]] pal [image] (load palette of given image) goto [+#|-#|# [images]] (go to given image in stack) next [images] (go to next image in stack) previous [images] (go to previous image in stack) c) Using macros Macros are ascii text files containing a list of commands to be executed by imgTECH/IV. Macros may be created by one of two ways: 1.Macros may be created by recording a series of keystrokes and then simply playing them back. 2.Macros be created using a text editor. This allows full use of the imgTECH/IV macro language. The syntax of which is described below: a. Variables may be of either numeric type or string type. String variables must be preceded by a dollar sign ($) to indicate to IV that the variable is of string type. For example: x=10 $i="imgTECH/IV" b. A block of commands may executed a number of times. Looping is provided as follows: The loop is initiated by a loop statement which indicates how many times the loop is to be repeated. A number or a numeric variable may be used for this purpose. The loop is terminated by a pool statement (loop spelled backwards). For example: loop x : pool c. A block of commands may be conditionally executed, or not as follows: An if statement containing a condition, initiates the block. The block is terminated by a fi statement. The condition has the form: if (number or variable)<=>(number or variable). If the condition is true, the block of commands will be executed, otherwise they will not. The else structure provides an alternative block of commands to execute if the condition is false. For example: if x=10 : else : fi ----- if $i != "imgTECH/IV" : fi d. Macro execution is terminated by an end statement. e. The following commands are provided for interactive operation: 1) echo "message to screen" Echos a message to the screen. The message remains there until it is unechoed. 2) unecho Unechoes an echoed message. 3) ask $string_variable "prompt" Prompts the user for a line of input, and stores the line in $string_variable. 4) getkey Halts execution until a key is pressed. 5) sleep # Halts execution for # seconds. # may be a number or a numeric variable. 6) Any command available from the IV command line may be used in a macro. d) Using image stacks There are a number of things to be aware of when working with image stacks: 1.All images in a stack have the same dimensions. IV will clip images as necessary to enforce this requirement. 2.Processing, by default occurs only on one image per stack (the image stored in memory -- all others are stored on disk -- thus greatly speeding up processing). However, an option may be set so that processing occurs on all images in the stack (menu: OPTIONS/PROCESSING/STACK or command line: set|unset stack). 3.Each image in a stack of color images may have a different palette. 4.PGUP and PGDN will scroll through the stack. e) Using help To get help, press F1. The arrow keys and PGUP and PGDN scroll through the help. Clicking (with the left mouse button) on a highlighted item (normally displayed in blue) will cause the help system to display information on that item. Pressing ESC causes the help window to close. f) IV hotkeys 1.ESC: a) cancels help. b) aborts processing. c) aborts a menu or dialog box. d) interrupts macro execution. e) closes an option window. 2.F1: opens help window. 3.PGUP/PGDN: scrolls through an image stack. 4.F2: toggles between full screen mode and non full screen mode. 5.ALT+U: undo. redo is achieved by undoing and undo. Note: this only applies when backup is off (menu: OPTIONS/PROCESSING/BACKUP of command line: set|unset backup) 6.If an image does not fit on the screen, the following key strokes will scroll the image: CTRL+U: scroll up CTRL+D: scroll down CTRL+L: scroll left CTRL+R: scroll right 7.ALT+X: quits IV. g) IV options OPTIONS/PROCESSING 1.Operate on image stacks (y or n). By default (for speed) processing only occurs on the image in the stack that is currently displayed (ie stored in memory). Set this option to 'y' to cause IV to operate on every image in the stack. 2.Maintain backups (y or n). By default IV creates a new image every time it performs an image processing function. This can rapidly fill up memory. Setting this option to 'n' will cause IV to discard the original image after it has been processed. Any operation may then be undone with ALT+U. Redo is accomplished by undoing an undo. OPTIONS/MOVIE 1.Wait for keystroke (y or n). IV will wait for a keystroke between every frame in the movie. 2.Delay (in ms). Specify a delay to be inserted between every frame. 3.Play backwards (y or n). Play the movie backwards. 4.Continuous play (y or n). The movie will play over and over until ESC is pressed. 5.Full Screen (y or n). Show the movie in full screen mode (nothing but the image on the screen). OPTIONS/OTHER 1.Show Coordinates (y or n). By default, when the mouse is positioned on an image, the coordinates and pixel intensity is displayed in the upper right hand corner of the screen. This may be turned off. 2.Show Palette Bar (y or n). By default the currently loaded palette is displayed in the upper right hand corner of the screen. This may be turned off. 3.Gamma correction. Gamma determines the way color contrast is displayed. Changing gamma changes the contrast. The default value is 1. 4.JPEG quality. JPEG is a lossy format (ie. some information is lost). The quality factor, ranging between zero and one hundred, determines how much information is lost. It also determines the compression ratio (the lower the quality factor, the higher the compression ratio). By default, the quality factor is set to 75. OPTIONS/DIRECTORY This option specifies the directory in which IV looks for it's data files. OPTIONS/SAVE The current option settings may be saved in a file called iv.rc from which they will be reloaded the next time IV starts. ---- 1. The routines used to read and write JPEG images were derived from from code provided by the Independant JPEG Group. Therefore, this software is based in part on the work of the Independant JPEG group. 2. The Graphics Interchange Format(c) is the Copyright property of CompuServe Incorporated. GIF(sm) is a Service Mark property of CompuServe Incorporated. 3. Windows(c) is a copyright of Microsoft Corp. 4. OS/2(tm) is a trademark of International Business Machines Corp.